package com.masohost.cocoadroid;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class SecondActivity extends Activity implements OnClickListener {
	ImageView img1;
	ImageView img2;
	ImageView img3;
	ImageView img4;
	ImageView img5;
	ImageView img6;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		try{
			// TODO Auto-generated method stub
			super.onCreate(savedInstanceState);
			setContentView(R.layout.second);	
			
			loadMenu();
		}
		catch (Exception e) {
		}
	}
	
    public void loadMenu(){
    	
		View view;
		LinearLayout layMenu  = (LinearLayout)findViewById(R.id.layMenu);
		view = View.inflate(this,R.layout.menu, null);
		
		layMenu.addView(view);
		
		setMenuListeners();
		
    }
        
    private void setMenuListeners(){
   	 	img1 = (ImageView)findViewById(R.id.img1);
        img1.setOnClickListener(this);
        
        img2 = (ImageView)findViewById(R.id.img2);
        img2.setOnClickListener(this);
        
        img3 = (ImageView)findViewById(R.id.img3);
        img3.setOnClickListener(this);
        
        img4 = (ImageView)findViewById(R.id.img4);
        img4.setOnClickListener(this);
        
        img5 = (ImageView)findViewById(R.id.img5);
        img5.setOnClickListener(this);
       
        img6 = (ImageView)findViewById(R.id.img6);
        img6.setOnClickListener(this);
   }

	public void onClick(View v) {
		
		try{
			
			Intent question = new Intent(this,com.masohost.cocoadroid.CocoaDroidActivity.class);
			startActivity(question);
			
		}
		catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
}
